<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="/tpshop/Public/common/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.left div{
				display: none;
			}
		</style>
		<script type="text/javascript">
			$(function(){
				
				
			});
		</script>
	</head>
	<body>
		<header>
			<div>
				<ul>
					<li><a href="">清除缓存</a></li>
					<li>
						<a href="">后台管理</a>
						<ul>
							<li><a href="">Admin</a></li>
							<li><a href="">修改密码</a></li>
							<li><a href="">前台首页</a></li>
							<li><a href="">退出</a></li>
						</ul>
					</li>
				</ul>
			</div>
		</header>
		
		<!--内容区域-->
		<div class="main">
			<div class="left">
				<h2 id="Admin">管理员管理</h2>
				<div class="item">
					<p><a href="<?php echo U('Admin/index');?>">管理员列表</a></p>
				</div>
				
				<h2 id="User">用户管理</h2>
				<div class="item">
					<ul>
						<li><a href="<?php echo U('User/index');?>">用户列表</a></li>
					</ul>
				</div>
				
				<h2 id="User">分类管理</h2>
				<div class="item">
					<ul>
						<li><a href="<?php echo U('Types/index');?>">分类列表</a></li>
					</ul>
				</div>
				
				<h2 id="User">系统管理</h2>
				<div class="item">
					<ul>
						<li><a href="<?php echo U('Sys/lunbo_list');?>">轮播图列表</a></li>
					</ul>
				</div>
			</div>
			
			<div class="right">
				
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script src="/tpshop/Public/common/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
		<script type="text/javascript">
			$(function(){
				var img = '';
//				$('#ups').change(function(){
//					$.post("<?php echo U('ajax_up');?>",
//				    {
//				        
//				    },
//				        function(data,status){
//				        alert("数据: \n" + data + "\n状态: " + status);
//				    })
//				});
				
				$('#ups').change(function(){
					var form = $('#lunbo_form')[0];
					var formdata1 = new FormData(form);
//					console.log(formdata1);
					
					$.ajax({  
				        type : "post",  
				        url : "<?php echo U('ajax_up');?>",  
				        data : formdata1,
				        async: false,  
				        cache: false,  
				        contentType: false,  
				        processData: false,
				        success : function(data) {  
				            if(data){
				            	//alert('提交成功！');
				            	$('#img_post').val(data);
				            	var img = "<img width='200' height='200' src='/tpshop/Uploads/" + data + "' />";
				            	$('.img').html(img);
				            } 
				        }  
					}); 
				});
				
					
			});
		</script>
	</head>
	<body>
		<form id="lunbo_form" action="<?php echo U('lunbo_insert');?>" method="post" enctype="multipart/form-data">
			name:<input type="text" name="name" value="" />
			sort:<input type="text" name="sort" value="" />
			url:<input type="text" name="url" value="" />
			<input type="hidden" name="img" id="img_post" value="" />
			<div class="img">
				
			</div>
			<input type="file" name="ups" id="ups" value="" />
			<input type="submit" value="添加"/>
		</form>
	</body>
</html>

			</div>
			
		</div>
			
	</body>
	<script type="text/javascript">
		$(".left h2").click(function(){
			$(this).next().toggle(300);
			$('.left div').not($(this).next()).hide(300);
//					$(".item ul").hide();
//					$(this).parent().next().toggle(500);
				});
				var cName = "<?php echo (CONTROLLER_NAME); ?>";
				$("#" + cName).click();
	</script>
</html>